#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	int i = 0;
	int j = 0;
	int x = 0;
	int y = 0;
	int arr[100] = { 0 };
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	for (i = 0; i < n - 1; i++)
	{
		if (arr[i] <= arr[i + 1])
		{
			x++;
		}
		else if (arr[i] >= arr[i + 1])
		{
			y++;
		}

	}
	if (x == n - 1 || y == n - 1)
	{
		printf("sorted");
	}

	else
	{
		printf("unsorted");
	}
	return 0;
}